package com.lxm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lxm.dto.*;
import com.lxm.entity.Login;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
 * <p>
 * 用户登录表 服务类
 * </p>
 *
 * @author ${author}
 * @since 2024-10-02
 */
public interface LoginService extends IService<Login> {

    Result loginByPhone(PhonePwdLoginDTO login, HttpServletResponse response);

    Result loginByNickName(NickNamePwdLoginDTO login, HttpServletResponse response);

    Result loginByPhoneCode(PhoneCodeLoginDTO phoneCodeLoginDTO, HttpServletResponse response);

    /**
     * 退出登录,用户和管理员公用一个
     *
     * @param request
     * @return
     */
    String logout(HttpServletRequest request);


    /**
     * 获取用户头像和昵称信息
     *
     * @param userId 用户id
     * @return 用户的头像和昵称信息
     */
    Login getUserInfoLogin(Long userId);

    Result updateNickNameAndIcon(UserNickNameAndIconModifyDTO userNickNameAndIconModifyDTO);
}
